/-app ...
/-app/tests ...
TestCase.ts
TestPage.ts
Application.ts
/-boot
/-imports
/-storage
/-tests
/-typings
stringUtils.ts
teapo.html
1
module teapo.app.tests {
2
 
3
  export class TestCase {
4
 
5
    state = ko.observable(TestCase.State.NotStarted);
6
    runtime = ko.observable<number>(null);
7
    failure = ko.observable<Error>(null);
8
 
9
    private _started = -1;
10
 
11
    constructor(
12
      public name: string,
13
      private _test: Function) {
14
    }
15
 
16
    start() {
17
      if (this.state() !== TestCase.State.NotStarted)
18
        throw new Error('Test case already started (' + TestCase.State[this.state()] + ').');
19
 
20
      this.state(TestCase.State.Running);
21
      this.runtime(0);
22
      this._started = 0;
23
 
24
      try {
25
      }
26
      catch (error) {
27
        this.state
28
      }
29
    }
30
  }
31
 
32
  export module TestCase {
33
 
34
    export enum State {
35
      NotStarted,
36
      Running,
37
      Succeeded,
38
      Failed
39
    }
40
 
41
  }
42
 
43
}